/* ===== 响应式设计 ===== */

/* 大屏幕优化 (1200px+) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }

    .hero-title {
        font-size: 5rem;
    }

    .section-title {
        font-size: 3.5rem;
    }

    .content-grid {
        gap: 3rem;
    }

    .text-card {
        padding: 3rem;
    }

    .dreams-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 2rem;
    }
}

/* 平板设备 (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        padding: 0 3rem;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .nav-menu {
        gap: 1.5rem;
    }

    .dreams-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .timeline::before {
        left: 40px;
    }

    .timeline-item,
    .timeline-item:nth-child(odd) {
        margin-left: 80px;
    }

    .timeline-icon {
        left: 40px;
    }

    .text-card,
    .flow-card,
    .dream-category {
        padding: 2rem;
    }

    .metaphor-card,
    .realization-card,
    .gratitude-card,
    .ending-promise {
        padding: 2.5rem;
    }
}

/* 小型平板 (600px - 768px) */
@media (min-width: 600px) and (max-width: 768px) {
    .section {
        padding: 4rem 0 2rem;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .section-subtitle {
        font-size: 1.1rem;
    }

    .nav-logo {
        font-size: 1.3rem;
        left: 1.5rem;
    }

    .nav-toggle {
        right: 1.5rem;
    }

    .dreams-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .music-player {
        max-width: 350px;
    }
}

/* 手机设备 (320px - 600px) */
@media (max-width: 600px) {
    .container {
        padding: 0 1.5rem;
    }

    .section {
        padding: 3rem 0 2rem;
        min-height: 80vh;
    }

    .hero-section {
        min-height: 100vh;
    }

    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    /* 导航优化 */
    .nav-container {
        padding: 0.8rem 0;
    }

    .nav-logo {
        font-size: 1.2rem;
        left: 1rem;
    }

    .nav-toggle {
        right: 1rem;
    }

    .nav-menu {
        top: 60px;
        padding: 1.5rem 0;
    }

    .nav-menu li {
        margin: 0.5rem 0;
    }

    .nav-menu a {
        font-size: 1.1rem;
        padding: 0.8rem 0;
    }

    /* 内容卡片优化 */
    .text-card,
    .flow-card,
    .dream-category,
    .dreams-list {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .metaphor-card,
    .realization-card,
    .gratitude-card,
    .ending-promise {
        padding: 2rem;
        margin: 2rem 0;
    }

    .poem-text,
    .flow-text,
    .metaphor-text,
    .realization-text,
    .gratitude-text {
        font-size: 1rem;
        line-height: 1.7;
    }

    .text-card.highlight .poem-text {
        font-size: 1.1rem;
    }

    /* 时间轴优化 */
    .timeline {
        margin: 0;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item,
    .timeline-item:nth-child(odd) {
        margin-left: 50px;
        margin-bottom: 2rem;
    }

    .timeline-content {
        width: calc(100% - 30px);
        padding: 1.5rem;
    }

    .timeline-icon {
        left: 20px;
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    /* 时刻容器优化 */
    .moment-container,
    .conversation-flow,
    .meeting-moment {
        margin: 0;
    }

    .date-highlight {
        font-size: 1.3rem;
    }

    .moment-quote.large-text p {
        font-size: 1.2rem;
        line-height: 1.8;
    }

    .impact-text {
        font-size: 1.5rem;
    }

    .dream-title {
        font-size: 1.5rem;
    }

    .dream-category h3 {
        font-size: 1.5rem;
    }

    .dream-category ul {
        font-size: 0.95rem;
    }

    .promise-text {
        font-size: 1.1rem;
    }

    .final-line {
        font-size: 1.3rem;
    }

    /* 音乐播放器优化 */
    .music-player {
        flex-direction: column;
        padding: 1.5rem;
        margin: 2rem 1rem;
    }

    .play-btn {
        width: 45px;
        height: 45px;
    }

    .track-info {
        text-align: center;
        margin-top: 1rem;
    }

    /* 相册优化 */
    .gallery-upload {
        margin-bottom: 2rem;
    }

    .upload-area {
        padding: 2rem;
    }

    .upload-icon {
        font-size: 2.5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .photo-placeholder {
        min-height: 140px;
        padding: 1.5rem;
    }

    /* 滚动指示器优化 */
    .scroll-indicator {
        bottom: 1rem;
    }

    .scroll-arrow {
        width: 25px;
        height: 25px;
    }
}

/* 超小屏幕设备 (320px - 400px) */
@media (max-width: 400px) {
    .container {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .nav-logo {
        font-size: 1.1rem;
    }

    .text-card,
    .flow-card,
    .dream-category {
        padding: 1.2rem;
    }

    .metaphor-card,
    .realization-card,
    .gratitude-card,
    .ending-promise {
        padding: 1.5rem;
    }

    .poem-text,
    .flow-text,
    .metaphor-text {
        font-size: 0.95rem;
    }

    .date-highlight {
        font-size: 1.2rem;
    }

    .impact-text {
        font-size: 1.3rem;
    }

    .dream-title {
        font-size: 1.4rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .photo-placeholder {
        min-height: 120px;
        padding: 1rem;
    }

    .placeholder-content span {
        font-size: 1.5rem;
    }

    .placeholder-content p {
        font-size: 0.85rem;
    }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .section {
        min-height: 100vh;
        padding: 2rem 0;
    }

    .hero-section {
        min-height: 100vh;
    }

    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .hero-content {
        padding: 1rem 0;
    }

    .section-title {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }

    .section-header {
        margin-bottom: 1.5rem;
    }

    .nav-container {
        padding: 0.5rem 0;
    }

    .timeline-item {
        margin-bottom: 1.5rem;
    }

    .text-card,
    .flow-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .nav-container {
        border-bottom-width: 0.5px;
    }

    .text-card,
    .flow-card,
    .dream-category {
        border-width: 0.5px;
    }

    .timeline::before {
        width: 1px;
    }

    .scroll-arrow {
        border-width: 1px;
    }
}

/* 打印样式 */
@media print {
    .nav-container,
    .music-player,
    .scroll-indicator,
    .gallery-upload,
    .floating-petals {
        display: none !important;
    }

    .section {
        min-height: auto !important;
        padding: 1rem 0 !important;
        page-break-inside: avoid;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 12pt !important;
    }

    .text-card,
    .flow-card,
    .dream-category {
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        margin-bottom: 1rem !important;
        page-break-inside: avoid;
    }

    .hero-title,
    .section-title {
        color: black !important;
        text-shadow: none !important;
    }
}

/* 无障碍优化 */
@media (prefers-reduced-motion: reduce) {
    .floating-petals::before,
    .floating-petals::after,
    .scroll-indicator,
    .heart-beat-text {
        animation: none !important;
    }

    .nav-menu a {
        transition: none !important;
    }

    .text-card:hover,
    .flow-card:hover,
    .dream-category:hover {
        transform: none !important;
        transition: none !important;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #1a1a1a;
        --text-color: #f0f0f0;
        --secondary-color: #b0b0b0;
        --card-bg: rgba(40, 40, 40, 0.9);
    }

    body {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }

    .nav-container {
        background: rgba(26, 26, 26, 0.95);
        border-bottom-color: rgba(212, 175, 55, 0.3);
    }

    .text-card,
    .flow-card,
    .dream-category {
        background: var(--card-bg);
        color: var(--text-color);
    }

    .hero-quote,
    .upload-area {
        background: rgba(40, 40, 40, 0.7);
        color: var(--text-color);
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .nav-menu a:hover::after,
    .text-card:hover,
    .flow-card:hover,
    .dream-category:hover,
    .upload-area:hover {
        transform: none;
    }

    .nav-menu a:active::after {
        width: 100%;
    }

    .text-card:active,
    .flow-card:active,
    .dream-category:active {
        transform: scale(0.98);
    }

    .play-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-toggle span {
        min-height: 3px;
    }
}